/*
 * @Description: 
 * @Author: diyhome
 * @Date: 2021-01-01 6:42
 * @File: mpu6050_cpp
*/

#ifndef MPU6050_F4_MPU6050_CPP_H
#define MPU6050_F4_MPU6050_CPP_H

#include <stdint-gcc.h>

enum class settings{
    // 加速度传感器范围
    accel_2g = 0,
    accel_4g = 1,
    accel_8g = 2,
    accel_16g = 3,

    // 陀螺仪传感器范围
    gyro_250dps = 0,
    gyro_500dps = 1,
    gyro_1000dps = 2,
    gyro_2000dps = 3
};

namespace mpu6050_hal {
    class mpu6050_cpp {
    public:
        float pitch, roll, yaw;
        short gx, gy, gz;
        short ax, ay, az;

        float get_temperature();
        mpu6050_cpp();
        mpu6050_cpp(settings accel, settings gyro);

    private:

        void get_acceleration();        // 获取加速度
        void get_gyro_speed();          // 获取速度
    };
    class mpu6050_dmp {
    public:
        mpu6050_dmp();
        uint8_t read_dmp();
        float get_temperature();

        float pitch, roll, yaw;
    };
}

#endif //MPU6050_F4_MPU6050_CPP_H
